
<!--#include virtual="/dzps/p1.asp"-->
<%
'card_post=id,title,cover_path,keywords,add_time,mod_time,pub_time,description,content,views,cat_id,user_id,allow_comment,is_display,is_delete,is_audit,comment_count,view_count,zan_count,cai_count,is_top,log1_id
sub auto_create_first_log1
	dim rc1,sql
	vas "log1_id",val("id")
	rc1=rc("select id from tl_post where log1_id={log1_id:int}")
	if rc1=0 then
		vas "title","开工"
		vas "user_id",session("user_id")
		sql=cr("[tl_post]","title,log1_id,user_id")	
		easp.db.Exec(sql)
		vas "title",""
	else
		vas "bq" ," 共" &rc1& "条记录"
	end if
end sub	

%>
<!DOCTYPE html>
<html>
<head>
<%easp.include "h.asp"
	auto_create_first_log1
%>
<style type="text/css">
html {
    background-color: #f9f3f300;
    color: #666;
}
h5 {
    font-weight: 100;
    font-size: .9em;
    margin: 0;
	text-align: right;
    word-spacing: 5px;
}
</style>
</head>
<body>
  <div class="layui-form layui-form-pane" style="padding: 20px 0 0 0;">
  <blockquote class="layui-elem-quote layui-quote-nm">工单处理时重要事项记录</blockquote>
<%
	i_h "log1_id",val("id")
	echo js2("input1_block.html","title","记录",val("title"),"required")
%>
<button type="button" class="layui-btn" lay-filter="_test">刷新</button>			

<hr class="layui-bg-orange">
    <div class="layui-form-item layui-hide">
      <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
  </div>
       <div class="layui-card">
        <div class="layui-card-header">处理过程<%=zkh(val("bq"))%></div>
			<div class="layui-card-body">
				<ul class="layuiadmin-card-status layuiadmin-home2-usernote">
				<%
					' dim i,arr
					' arr= sql2arr("select a.add_time,title,user_id,b.username from tl_post a,[user] b where a.user_id=b.id and log1_id={id:int} order by a.id desc")
					' if ubound(arr)>0 then
					' for i=0 to ubound(arr,2)
						' echo(myjs1("timeline.html","timeline-title|"&arr(0,i) &",timeline-content|"& arr(1,i) & "<br>" & "<h5>发布：" & arr(3,i) &"</h5>" )) 
					' next
					' end if
				%>		  
				</ul>
			</div>
      </div>	  
			<div id="demo8"></div>

      </div>
</div>
  <script src="/<%=rootpath%>/src/layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/<%=rootpath%>/src/layuiadmin/' 
  }).extend({
    index: 'lib/index' 
  }).use(['index', 'set','form', 'upload','user','laypage'],function(){
    var $ = layui.$
    ,setter = layui.setter
    ,admin = layui.admin,laypage=layui.laypage
    ,form = layui.form;  

	$('#title').focus();
	gettl();
	
	$("#title").keypress(function (even) {
	   if (even.which == 13) {
			$.post('pjson.asp?now=' + new Date().getTime(), {
				action: "log1_tlp_add",log1_id:<%=val("id")%>,title:$("#title").val()				
			},
			function(data) {
				var jsonObj = $.parseJSON(data);
				layer.msg(jsonObj.msg);
			});
		gettl();
		$("#title").val('');
		//location.reload();			
		}
	});

	function gettl(){
		$(".layui-card").html("<ul id='tl' class='layuiadmin-card-status layuiadmin-home2-usernote'></ul>");
		$.post('pjson.asp?now=' + new Date().getTime(), {
			action: "tl_post",
			page:1,limit:10,log1_id:<%=val("id")%>
		},
		function(data) {
			var jsonObj = $.parseJSON(data).data;
			$.each(jsonObj,function(i,item){
				$("#tl").append("<li class='layui-timeline-item'><i class='layui-icon layui-timeline-axis'></i><div class='layui-timeline-content layui-text'><h3 class='layui-timeline-title'>"+item.add_time+ "</h3><p>"+ item.title +"<br></p><h5>发布："+item.username+"</h5>      <p></p></div></li>");
				//alert(i + item.title);
			});
		});	
	
	}

    $("[lay-filter='_test']").click(function(){
		gettl();
		
	});

  laypage.render({
    elem: 'demo8'
    ,count: 1000
    ,layout: ['limit', 'prev', 'page', 'next'],jump: function(obj, first){
    //obj包含了当前分页的所有参数，比如：
    console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
    console.log(obj.limit); //得到每页显示的条数
    
    //首次不执行
    if(!first){
      //do something
	  
    }
  }
  });
	
  });
  </script>  
</body>
</html>